In formulating mathematical expressions it can be useful to employ computer-based programs which allow a user to enter the mathematical expressions for display on a screen. The program should also allow for formatting and editing of the mathematical expressions. These programs are typically and generically identified as equation editors, mathematics editors, and/or expression editors, and are usually based on presentation-tree type object oriented data structures.
In addition to providing equation editors, users frequently have the need of a computer algebra system (CAS) program which allows for the manipulation of mathematical expressions in symbolic form. Such programs typically also can be used to determine a numerical solution to a mathematical equation. These programs are usually based on content-tree type object oriented data structures. One such program is sold under the name “Maple” by Maplesoft of Waterloo, Ontario, Canada.
Mathematical expressions can be represented by different types of expression trees. Conventional expression trees for mathematical expressions can be in the form of presentation trees or content trees. Presentation trees are primarily for entering, editing and displaying (i.e., presenting) the expressions. Content trees are primarily used to allow mathematical expressions to be manipulated and/or solved using a CAS program, or calculated numerically as with a scientific calculator.
U.S. Pat. No. 6,610,106 (“Jenks”) describes an “Expression Editor” for creating and editing mathematical formulas, implemented as a computer software program. As a formula is entered by a user, the program forms a first expression tree in the form of a presentation tree which allows editing of the formula. The program also generates a second expression tree in the form of a content tree which allows use with a CAS program. Editing of the mathematical formula results in automatic modification of both of the expression trees.
Prior art equation editors do not inherently take into account mathematical meaning when entering, editing and manipulating mathematical expressions into the editor. It is desirable to provide an equation editor which allows for formatting and editing of mathematical expressions in a manner which enhances comprehension by the user of mathematical fundamentals, and which can also convert a presentation version of the mathematical expressions into content versions for use with CAS programs. Further, prior art mathematics systems need both the presentation tree data structure and the content tree data structure in order to allow editing and solving of mathematical expressions. It is desirable for an expression editor to take into account mathematical meaning so as to provide a more natural user interface. Prior art equation editors inherently do not do this.
Embodiments provided for herein include a class of data structures that can serve as the basis for expression editors as well as for mathematical computation software (both symbolic and numeric). The expression editors allow a user to create and edit mathematical expressions in real time—that is, in so-called “what-you-see-is-what-you-get” or “WYSIWYG” style. Other embodiments include a method for converting between the data structure described herein and a conventional content-tree data structure which can be used with conventional CAS or numerical calculation software.